<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Basic Macro Manual</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	<body>
		<div align="center">
			<span class="small_head">
					Table of Contents
			</span>
		</div>
		<ul class="basic_list">
			<li><a href="#General Information">General Information</a>
			<li><a href="#Types of Macros">Types of Macros</a>
			<li><a href="#Attributes">Attributes</a>
			<li><a href="#Variables">Variables</a>
			<li><a href="#Commands">Commands</a>
		</ul>
		<hr>
		<a name="General Information" class="small_headLeft">General Information</a>

		<p>
			<strong>How Clan Lord Loads Macro Files</strong>
		</p>
		<p>
			When you join a game or choose "Reload Macros" from the Options menu, Clan Lord will load the file with the same name as your character from the Macros folder.
			If no such file exists then it creates a new one. It also creates the macro folder and a file named "Default" if they do not exist. You can tell Clan Lord to load other files located in the Macro folder by having a line like:
		</p>
		<blockquote>
			<p>
				<em>
					include "Default"
					<br>
					include "Item Macros"
				</em>
			</p>
		</blockquote>
		<p>
			This statement loads the other file exactly as if it were inserted where the "include" is.
		</p>
		
		<h3>Macro Declarations</h3>
		<p>
			A macro consists of a "trigger" which explains when it should be done, and "commands" which define what it should do. There are two possible ways of declaring a macro, a short form and a long form. If you have more than one command you must use the long form, but with one command you can use either.
		</p>
		<blockquote>
			<p>
				<strong>SHORT FORM</strong>
			</p>
			<p>
				<em>trigger command</em>
			</p>
			<p>
				<strong>LONG FORM</strong>
			</p>

			<p>
				<em>
					trigger
					<br>
					{
					<br>
					&nbsp;&nbsp;command
					<br>
					&nbsp;&nbsp;command
					<br>
					&nbsp;&nbsp;command
					<br>
					&nbsp;&nbsp;(as many commands as you want, 1 per line)
					<br>
					}
				</em>
			</p>
		</blockquote>

		<h3>Controlling Execution</h3>
		<p>
			Whenever a macro is executing, the text box will display a thicker outline. Typing <b>control-escape</b> will stop all executing macros. More than one macro may be executing at the same time. Some environmental variables can also be set to control how a macro behaves. See the variable section, below.
		</p>
		<h3>Escape Characters</h3>
		<p>
			In order to use special characters which control how CL loads macros in an expression, you must use a backslash (\) before them. Commonly used ones:
		</p>
		<blockquote>
			<p>
				\\ backslash
				<br>
				\" double quote
				<br>
				\' single quote
				<br>
				\r return
				<br>
            </p>
		</blockquote>
		<p>
			NOTE: When you type a command directly in CL, you can begin it with either a forward or backward slash: either / or \ will work. However, within a macro expression, you MUST use '/': write "/action", NOT "\action".
		</p>
		
		<h3>Comments</h3>

		<p>
			Any line beginning with // is a comment and will be ignored.
		</p>
		<blockquote>
			<p>
				<em>// This is a comment</em>
			</p>
		</blockquote>
		<p>
			Any text between /* and */ is also a comment.  This kind of comment can span multiple lines.
		</p>
		<blockquote>
			<p>
				/*
				<br>
				&nbsp;&nbsp;This is a longer comment
				<br>
				&nbsp;&nbsp;that occupies more than one line.
				<br>
				*/
			</p>
		</blockquote>
		<hr>
		<a name="Types of Macros" class="small_headLeft">Types of Macros</a>
		<h3>Expression Macros</h3>
		<blockquote>
			<p>
				<em>"expression"</em>
			</p>
			<p>
				(the expression in quotation marks - case sensitive)
			</p>
		</blockquote>
		<p>
			These are triggered when you hit the Return key and the trigger expression begins the line. An expression with spaces in it will not work as a trigger, because only the first word of the line will be examined to see if it matches.
		</p>
		<p>
			<strong>Examples</strong>
		</p>
		<blockquote>
			<p>
				"lol" "/action laughs until he cries.\r"
				<br>
				<br>
				"jump" "/action nimbly jumps over the " @text "\r"
				<br>
				<br>
				"grfem"
				<br>
				{
				<br>
				&nbsp;&nbsp;"Hello fair lady "
				<br>
				&nbsp;&nbsp;@text
				<br>
				&nbsp;&nbsp;"!\r"
				<br>
				}
            </p>
		</blockquote>

<p><strong>Replacement Macros</strong></p>
<blockquote>
 
		<p><em>'replacetext'				        </em></p>
		<p>(the word to replace in single quotation marks - case sensitive)				</p>
</blockquote>
<p>These are triggered when you are typing and hit any key that isn't
a letter or a number, and the trigger is the last word before the
insertion point. If you hit return, the last word of the line is
compared to trigger. You can type a space or a return without
triggering a replacement macro by holding down the control key
while typing them. Replacement macros end execution immediately, so
you cannot use any commands that cause a delay, nor any return (\r)
characters.  One good use of replacement macros is for
abbreviations that automatically expand themselves, as in the first
two examples below.<br>
</p>

<h4>Examples</h4>

<blockquote>
			<p>'OC' "Orga Camp"<br>
			  'ELF' "E\'las Loth\'mon Ferindril"
			'hi'<br>
			{<br>
&nbsp;&nbsp;random<br>
&nbsp;&nbsp;&nbsp;&nbsp;"H\'loi"<br>

&nbsp;&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;"Greetings"<br>
&nbsp;&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;"Good day"<br>
&nbsp;&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;"Good morning"<br>
&nbsp;&nbsp;end random<br>
			}
            </p>

</blockquote>

<h3>Key Macros</h3>

<blockquote>
 
			<p><em>key<br>
			modifier-key<br>
			modifier1-modifier2-key</em></p>
			<p>(the key to be pressed, with as many modifiers as you want)				</p>

</blockquote>

<p>Key macros are triggered by hitting the specified key combination. If a key combination would normally 
do something and you define a macro for it, your macro will be used <b>instead</b> of the normal action. 
For example, a command-p macro would override the 
Command menu "Pull" that's usually attached to that key combination. </p>
<p>For most keys, the character that is printed when you type the key is the key name, but some have 
special names:<p>
<b>Keys</b>:
f1 - f15, escape, minus, delete, tab, return, space, help, home, undo, del, end, pageup, pagedown, up, down, left, right, clear, enter, click
<p>
<b>Modifiers</b>:
command, control, numpad, option, shift
<h4>Option Key</h4>

<p>Using the option modifier with letters is a bit tricky because
typing option-letter often changes the letter. For example: On most
U.S. systems and keyboards, typing option-s actually produces the
single character &szlig;. So to use option-s as a macro key, you
will need to use the option-character in the macro definition. That
is, macros defined like this will set the text to "this succeeds"
when you hit option-s: </p>
<blockquote>
  <p> option-s "this fails"<br>
    option-&szlig; "this succeeds"
  </p>
</blockquote>


<h4>The "Click" Keys</h4>

<p>The "click" key lets you make clicking on a player with certain modifiers do something. The 
macro executes if you click on a player in the players' window or in the game window. The 
one exception is that a macro defined for a plain click with no modifiers won't work in the Players 
window (this would override you being able to use the Players window!). </p>
<p>
<b>OS X Only:</b>  If you have a multi-button mouse, you can also use the names "click2", "click3", 
etc. These are triggered when you press the corresponding mouse button. You may need to 
experiment a bit to find out what the button numbers are for your mouse. "Click2" is almost 
always the secondary or right button, but beyond that, the ordering is hardware-defined.  You'll
have to do some tests to figure out which buttons are which for your mouse.
"Right-click" is a synonym for "click2".
<h4>Examples</h4>

<blockquote>
			<p>f1 "/action twitches his tail.\r"<br>

			  <br>
			  command-m "/give " @selplayer.simple_name " 1\r"<br>
			  <br>
			  shift-enter "/action " @text "\r"<br>
			  <br>
			  command-option-&micro; "/pull " @selplayer.simple_name "\r"<br>

			  // Must be &micro, not m, because of the option key)<br>
			  <br>
			  command-control-numpad-option-shift-minus "BEER!\r"<br>
			  <br>
			control-option-click<br>
			{<br>

&nbsp;&nbsp;if @click.name != ""<br>
&nbsp;&nbsp;&nbsp;&nbsp;"Get out of my way " @click.name "!\r"<br>
&nbsp;&nbsp;end if<br>
			}
            </p>
</blockquote>

<h4>The "Wheel" Keys</h4>
<p><b>OS X Only:</b> If you have a scroll-wheel mouse, you can write macros that are triggered by 
moving the wheel. If you assign a macro to the "wheelup" pseudo-key, it'll be triggered when 
you scroll up; "wheeldown" works in the other direction. You can also assign macros to 
"wheelleft" and "wheelright", but they'll only work if: (a) you really do have a horizontal wheel, 
or (b) you're using OS X 10.2 or later, and you hold down the shift key while turning the 
regular (vertical) wheel. </p>

<h3>Function Macros</h3>

<blockquote>
  <p><em>trigger				  </em></p>
<p>(just the word that is the function name)				</blockquote>
<p>Function macros are triggered by a "call" command from within another macro. See the command section 
for more information. </p>
<h3>The "@login" Macro</h3>


<p>If you have a function macro called "@login", it will run automatically when you log into the 
game, or whenever you choose the "Reload Macros" menu item. </p>
<h4>Examples</h4>

<blockquote>
			<p>@login<br>
			{<br>
&nbsp;&nbsp;"/action yawns and stretches\r"<br>
&nbsp;&nbsp;pause 4<br>

&nbsp;&nbsp;"/pose sit\r"<br>
			}
            </p>
</blockquote>

<hr>			  <p><span class="small_headLeft"><a name="Attributes"></a>Attributes</span><br>
  <br>
An attribute is a line that you can put in a macro to change how it behaves. An attribute is not 
executed at a certain place in a macro; rather, it controls how CL and the macro interact.  Therefore, you 
can put an attribute anywhere in a macro. All attributes begin with a $ character.
</p>
<h3>Supported Attributes</h3>


<blockquote>
		  <p><b>$ignore_case</b><br>
			Only affects expression and replacement macros; makes the macro execute disregarding case.</p>
		  <p>
		  <b>$any_click</b><br>
			Normally click macros only execute if you click on a player. A click macro using this attribute will execute whenever you click anywhere in the 
			game window.</p>
		  <p>

			<b>$no_override</b><br>
			Normally macros override any further handling of a key, click, or typing. With this attribute the macro will be executed, and the normal action 
			for the click or key will also be done.		          </p>
</blockquote>

<h4>Examples</h4>
<blockquote>
		<p>A pair of macros that let you hold shift and click
		if you want to use click toggles mode and click
		normally for click and hold movement:</p>
		<p>

		
			shift-click<br>
			{<br>
			&nbsp;&nbsp;$no_override<br>
			&nbsp;&nbsp;$any_click<br>
			&nbsp;&nbsp;"/pref movement toggle\r"<br>
			}</p>

		<p>
			
		  click<br>
		  {<br>
		  &nbsp;&nbsp;$no_override<br>
		  &nbsp;&nbsp;$any_click<br>
		  &nbsp;&nbsp;"/pref movement hold\r"<br>

  }</p></blockquote>
        <hr>
        <p><br>
          <a name="Variables" class="small_headLeft">Variables</a><br>
          <br>
          A <i>variable</i> is the programming term for a name that is set to another value. For example, we might have a 
variable called <i>race</i>; we can set this variable to hold the value "Thoom". Now whenever we refer to the name, 
<i>race</i>, "Thoom" will be substituted. Later we could change <i>race</i> to be "Sylvan". Now we could do exactly 
what we did before, but every reference to <i>race</i> will now be substituted with "Sylvan" instead.

        </p>

<h3>Global Variables</h3>

<p>These variables are defined the same for <b>every</b> macro that you run. To define one, use a 
set statement that isn't inside any macro.
</p>
<blockquote>
  <p>
			set num 1<br>

			set who "Keriul"
  </p>
</blockquote>

<p>Notice that if the variable is text, you enclose it in quotation marks; and if it is numerical, you 
don't. Now we can use these values in any macro:

</p>
<blockquote>
			<p>"vartest2"<br>
			{<br>
&nbsp;&nbsp;"Hello " who " you are " num "\r"<br>

			}
            </p>
</blockquote>
<p>This will output:
</p>
<blockquote>
  <p>
			Hello Keriul you are 1 (return)
  </p>
</blockquote>


<h3>Local Variables</h3>

<p>These variables are defined only for the macro they are declared within. You declare them the same 
as you would a global variable, except they are within a macro.
</p>
<blockquote>
			<p>"vartest2"<br>
			{<br>
&nbsp;&nbsp;set num 1<br>
&nbsp;&nbsp;set who "Keriul"<br>

&nbsp;&nbsp;"Hello " who " you are " num "\r"<br>
			}
	        </p>
</blockquote>
	<p>This will output:
	</p>
	<blockquote>
	  <p>
				Hello Keriul you are 1 (return)
	  </p>

	</blockquote>
	
    <p>Now assume that we didn't have those global variable declarations described above, but we had these 
macros named vartest1 and vartest2 in the same macro file:
    </p>
<blockquote>
			<p>"vartest1"<br>
			{<br>
			&nbsp;&nbsp;"Hello " who " you are " num "\r"<br>
			}							</p>

			<p>"vartest2"<br>
			{<br>
			&nbsp;&nbsp;set num 1<br>
			&nbsp;&nbsp;set who "Keriul"<br>
			&nbsp;&nbsp;"Hello " who " you are " num "\r"<br>
	}					</p>

</blockquote>
	<p>vartest1 will output:
	</p>
	<blockquote>
	  <p>
			Hello you are (Return)
      </p>
</blockquote>

    <p>In vartest1 the variables who and num are not defined, so they count as nothing!

    </p>

<h3>Setting Global Variables from Within a Macro</h3>

<p>Suppose you had a global variable named <i>who</i> and you wanted a macro to be able to change it. To 
do this you use the <b>setglobal</b> command from within a macro:
<blockquote>
			set who "Kerial"
			<p>"set1"<br>
			{<br>

			&nbsp;&nbsp;setglobal who "Ternia"<br>
			}
			<p>"vartest1"<br>
			{<br>
			&nbsp;&nbsp;"Hello " who "\r"<br>
}				</blockquote>

<p>Now if you use vartest1 you get:
</p>

<blockquote>
  <p>
			Hello Kerial (return)
  </p>
</blockquote>

<p>But now if you type
</p>
<blockquote>
  <p>
			set1 (return)
  </p>

</blockquote>
<p>the set1 macro executes, changing the global variable, so that when you do vartest1 again you get:
</p>
<blockquote>
  <p>
			Hello Ternia (Return)
  </p>
</blockquote>

<h3>Global and Local Variables with the Same Name</h3>


<p>This is best shown by example.  You can have the same variable name for both 
a global and a local variable. If you change the local one, the global one won't be affected; 
it will remain the same in all other macros besides
the one in which there's now a local variable with the same name. 

</p>
<blockquote>
  <p> set who "Kerial"
  </p>
  <p>"set1"<br>
	{<br>
	&nbsp;&nbsp;set who "Ternia"<br>

	&nbsp;&nbsp;"Hello " who "\r"<br>
	}					</p>
  <p>"vartest1"<br>
	{<br>
	&nbsp;&nbsp;"Hello " who "\r"<br>
}			</p>

</blockquote>
<p>Now if you use set1 you get:
</p>
<blockquote>
  <p>
		Hello Ternia (return)
      </p>
</blockquote>
<p>But now if you use vartest1 you still get:
</p>

<blockquote>
  <p>
		Hello Kerial (return)
  </p>
</blockquote>

<h3>CL-Defined Variables</h3>
<p>By setting some special variables you can control how CL loads and uses macros. By putting 
others in your macros you can get information about your character or other characters. All special variables 
start with an @. The following is a list of all of these variables.				</p>
<blockquote>

			<p><b>@env Variables<br>
			</b>Variables with an @env prefix control how macros execute.
			</p>
			<blockquote>
						<p><b>@env.echo (true/false)</b><br>
						When true, then after any \r in a macro, replace the text in the input box by the text that was sent.
						</p>
						<p><b>@env.debug (true/false)<br>

						</b>When true, give extra information on macro loading and execution.										</p>
						<p><b>@env.key_interrupts (true/false)<br>
						</b>When true, stop executing a macro when a key is pressed.										</p>
						<p><b>@env.click_interrupts<br>
						</b>When true, stop executing a macro when you click in the game window (where clicks move your character).<b><br>
			</b>							</p>

			</blockquote>
			<p><b>@my Variables<br>
			</b>Variables with a @my prefix concern your character.
			</p>
			<blockquote>
						<p><b>@my.name<br>
						</b>Your character's name.
						
						</p>
						<p><b>@my.simple_name<br>

						</b>Your character's simple name (no spaces or punctuation)										</p>
						<p><b>@my.right_item, @my.left_item<br>
						</b>The names of the items in your right and left hands.										</p>
						<p><b>@my.right_item, @my.left_item
						@my.forehead_item, @my.neck_item, 
						@my.shoulders_item, @my.arms_item, 
						@my.gloves_item, @my.finger_item, 
						@my.coat_item, @my.cloak_item, 
						@my.torso_item, @my.waist_item, 
						@my.legs_item, @my.feet_item, @my.head_item<br>
						</b>The names of the items equipped in other locations.										</p>
						<p><b>@my.selected_item<br>

						</b>The name of the item that's currently selected 
			in the Inventory window.							</p>
			</blockquote>
			<p><b>@selplayer Variables<br>
			</b>Variables with a @selplayer prefix refer to the selected character.
			</p>
			<blockquote>
						<p><b>@selplayer.name<br>
						</b>Selected character's name.
						</p>

						<p><b>@selplayer.simple_name<br>
			</b>Selected character's simple name (no spaces or punctuation)							</p>
			</blockquote>
			<p><b>@click Variables<br>
			</b>Variables with a @click prefix refer to the character clicked on to begin a click macro.
			</p>
			<blockquote>
						<p><b>@click.name<br>

						</b>The clicked-on character's name.
						
						</p>
						<p><b>@click.simple_name<br>
						</b>The clicked-on character's simple name (no spaces or punctuation)										</p>
						<p><b>@click.button<br>
						</b>A number (from 1 to 8) that identifies which 
						mouse button was just pressed. The main or left 
						button is #1, the secondary or right button is 
						#2, additional button numbers are hardware-
						dependent.  You'll have to perform some tests to figure them out for your
						particular mouse.										</p>
						<p><b>@click.chord<br>

						</b>A number that indicates the state of all the 
						mouse buttons. This value is actually a bitmap 
						of all the currently pressed buttons, where the 
			lowest-order bit corresponds to button #1.							</p>
			</blockquote>
			<b>Miscellaneous Variables</b>
			<blockquote>
						<p><b>@text</b><br>
						The complete text in the typing box when the macro started.<br>
						(minus the expression of an expression macro)<br>

						<p><b>@textsel</b><br>
						The selected text in the typing box when the macro is started.
						<p><b>@random<br>
			</b>A number between 0 and 9999, randomly generated each time this variable is referenced.							</blockquote>
</blockquote>


<h3>Words and Letters</h3>
<p>By appending these trailers on the end of any variable you can refer to words or letters 
of that variable's value.				</p>

<blockquote>
			<p><b>.word[n]</b><br>
			The nth word of a variable. The first word is numbered zero.
			</p>
			<p><b>.num_words</b><br>
			The number of words in a variable.							</p>
			<p><b>.letter[n]</b><br>

			The nth letter of a variable. The first letter is numbered zero.							</p>
			<p><b>.num_letters</b><br>
The number of letters in a variable.				</p>
</blockquote>
<hr>			  
<p><a name="Commands" class="small_headLeft">Commands</a><br>
  <br>

If a line starts with a command word, then Clan Lord takes special action (described below for each 
command). Otherwise, the words in the line are just interpreted as text. You can only have one command per line. You can use variables for any of 
the parameters of the various commands.
</p>
<h3>Text</h3>
<blockquote>
			<p>"&lt;text&gt;"<br>
&lt;variable&gt;				</blockquote>


<p>If the first word of a line is not another command, then Clan Lord assumes this line is text. 
Any text in quotes is just inserted. Each item which is not in quotes is assumed to be a variable, and the value of the variable is inserted. As a macro 
executes, it concatenates text until it reaches an end-line character "\r", at which point it sends the text it has saved and pauses one frame. If there 
is text after the last "\r" of the macro, then this text is inserted into the text field. This means that if there are no "\r" characters, the text 
is simply inserted into the typing area, without being sent to the server. </p>
<h4>Examples</h4>
<blockquote>
			<p>"gr"<br>
			{<br>
			&nbsp;&nbsp;"Hello "<br>

			&nbsp;&nbsp;@selplayer.name<br>
			&nbsp;&nbsp;"!\r"<br>
			}<br>
			<p>Outputs:<br>
			&gt;Hello Joe! (Return)<br>
			// If you have Joe selected.
			<p>"/sleep"<br>

			{<br>
			&nbsp;&nbsp;"/pose lie\r" "/action lies down and closes his eyes.\r"<br>
			&nbsp;&nbsp;pause 10<br>
			&nbsp;&nbsp;"/sleep\r"<br>
			}
			<p>Outputs:<br>
			&gt;/pose lie (Return)<br>

			&gt;/action lies down and closes his eyes. (Return)<br>
			(Waits ten frames)<br>
			&gt;/sleep (Return)
			<p>f1 "/thinkto " @selplayer.simple_name " " @text "\r"<br>
			<p>Outputs:<br>
			&gt;/thinkto Thyin Where are you hunting? (Return)
			<p>// If tou have typed "Where are you hunting?" and have Thyin selected.
			<p>f13 "Tergon d\'Aleria mon\'Savreyte von Wendia"
			<p>// Inserts your very complicated name as if you had typed it.<br>

</blockquote>
<h3>Pause</h3>
<blockquote>
			<p><em>pause &lt;number&gt;</em>				</blockquote>
<p>Pauses the macro for &lt;number&gt; frames.
<h4>Examples</h4>

<blockquote>
			<p>shift-#<br>
			{<br>
			&nbsp;&nbsp;"/pose sit\r"<br>
			&nbsp;&nbsp;pause 1<br>
			&nbsp;&nbsp;"/pose leanleft\r"<br>

			&nbsp;&nbsp;pause 1<br>
			&nbsp;&nbsp;"/pose leanright\r"<br>
			&nbsp;&nbsp;pause 1<br>
			&nbsp;&nbsp;"/pose stand\r"<br>
			&nbsp;&nbsp;pause 1<br>
			}
			<p>// Makes your character do a simple dance (on shift 3)<br>

			<p>"pn"<br>
			{<br>
			&nbsp;&nbsp;"/action sits down and scratches his head.\r"<br>
			&nbsp;&nbsp;pause 20<br>
			&nbsp;&nbsp;"/ponder " @text "\r"<br>
			}
			<p>// If your character is dim-witted, adds a pause to every ponder.<br>

</blockquote>
<h3>Set</h3>
<blockquote>
			<p><em>set &lt;variable name&gt; &lt;value&gt;</em><br>
			OR<br>
			<em>set &lt;variable name&gt; &lt;operation&gt; &lt;value&gt;</em><br>

&lt;operation&gt; must be + - * / %				</blockquote>
<p>Sets the local variable or does an operation on its current value (see the variable section). 
The + operator can be used to concatenate two string variables, but all other operators assume numeric variables and give a numeric result.
<blockquote>
			<p>	string + string = concatenation		("a" + "b" = "ab")<br>
			number + number = addition		(1 + 2 = 3)<br>
			string + number = concatenation		("a" + 2 = "a2")<br>

number + string = not allowed		(1 + "b" : "Syntax error")				</blockquote>


<h3>SetGlobal</h3>
<blockquote>
			<p><em>setglobal &lt;variable name&gt; &lt;value&gt;</em><br>
			OR<br>

			<em>setglobal &lt;variable name&gt; &lt;operation&gt; &lt;value&gt;</em><br>
&lt;operation&gt; must be + - * / %				</blockquote>
<p>Sets a global variable or does an operation on its current value.
<h4>Examples</h4>

<blockquote>
			<p>set @env.echo true<br>
			<br>
			f7<br>
			{<br>
			&nbsp;&nbsp;set @env.echo false<br>
			&nbsp;&nbsp;"/action spins around until he falls down.\r"<br>

			}
			<p>// During this macro, text will not be echoed despite the global variable.
			<p>f8<br>
			{<br>
			&nbsp;&nbsp;set num 1<br>
			&nbsp;&nbsp;num "\r"<br>
			&nbsp;&nbsp;set num + 4<br>

			&nbsp;&nbsp;num "\r"<br>
			&nbsp;&nbsp;set num2 6<br>
			&nbsp;&nbsp;num2 "\r"<br>
			&nbsp;&nbsp;set num + num2<br>
			&nbsp;&nbsp;num "\r"<br>
			}
			<p>help<br>

			{<br>
			&nbsp;&nbsp;if @env.debug == true<br>
			&nbsp;&nbsp;&nbsp;&nbsp;setglobal @env.debug false<br>
			&nbsp;&nbsp;else<br>
			&nbsp;&nbsp;&nbsp;&nbsp;setglobal @env.debug true<br>
			&nbsp;&nbsp;end if<br>

			}
			<p>// toggle debugging on and off with this key
			<p>option-return<br>
			{<br>
			&nbsp;&nbsp;set on @text.num_words<br>
			&nbsp;&nbsp;set on - 1<br>
			&nbsp;&nbsp;label mark<br>

			&nbsp;&nbsp;@text.word[on]<br>
			&nbsp;&nbsp;if on &gt; 0<br>
			&nbsp;&nbsp;&nbsp;&nbsp;" "<br>
			&nbsp;&nbsp;&nbsp;&nbsp;set on - 1<br>
			&nbsp;&nbsp;&nbsp;&nbsp;goto mark<br>

			&nbsp;&nbsp;end if<br>
			&nbsp;&nbsp;"\r"<br>
			}
<p>// talk backwards				</blockquote>
<h3>Call</h3>
<blockquote>
  <p><em>call &lt;function&gt;</em><br>

&lt;function&gt; must be a valid declared function				</blockquote>
<p>Executes the given macro function at this point in the macro. This function and the calling 
function share local variables.
<h4>Examples</h4>
<blockquote>
			<p>subroutine<br>
			{<br>

			&nbsp;&nbsp;who " is a " prof ".\r"<br>
			}
			<p>f6<br>
			{<br>
			&nbsp;&nbsp;set who "Zephyr"<br>
			&nbsp;&nbsp;set prof "Healer"<br>
			&nbsp;&nbsp;call subroutine<br>

			&nbsp;&nbsp;set who "Aki"<br>
			&nbsp;&nbsp;set prof "Mystic"<br>
			&nbsp;&nbsp;call subroutine<br>
			}<br>
</blockquote>
<h3>Random</h3>

<blockquote>
  <p><em>random &lt;option&gt;<br>
&lt;commands&gt;<br>
  or<br>
&nbsp;&nbsp;&lt;commands&gt;<br>
  or<br>
&nbsp;&nbsp;&lt;commands&gt;<br>

  ...<br>
  end random
  </em>
  
<p>&lt;option&gt; can be "no-repeat"				</blockquote>
<p>Randomly chooses one of the choices to execute from the list. If &lt;option&gt; is "no-repeat", 
then it will never choose the same one twice in a row, unless there's only one choice total (in which case "no-repeat" is impossible).  If you don't
specify "no-repeat", then each alternative is equally likely.
<h4>Examples</h4>

<blockquote>
			<p>"greet"<br>
			{<br>
			&nbsp;&nbsp;random<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"Greetings "<br>
			&nbsp;&nbsp;or<br>

			&nbsp;&nbsp;&nbsp;&nbsp;"H'loi "<br>
			&nbsp;&nbsp;or<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"Good day "<br>
			&nbsp;&nbsp;end random<br>
			&nbsp;&nbsp;@selplayer.name "\r"<br>
			}
			<p>f10<br>

			{<br>
			&nbsp;&nbsp;"/action "<br>
			&nbsp;&nbsp;random no-repeat<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"smiles."<br>
			&nbsp;&nbsp;or<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"grins."<br>

			&nbsp;&nbsp;or<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"chuckles."<br>
			&nbsp;&nbsp;end random<br>
			&nbsp;&nbsp;"\r"<br>
			}
<p>// The same expression will never result twice in a row				</blockquote>
<h3>If</h3>

<blockquote>
			<p><em>if &lt;expression&gt; &lt;comparison&gt; &lt;expression&gt;<br>
&nbsp;&nbsp;&lt;commands&gt;<br>
else if &lt;expression&gt; &lt;comparison&gt; &lt;expression&gt;<br>

&nbsp;&nbsp;&lt;commands&gt;<br>
			else<br>
&nbsp;&nbsp;&lt;commands&gt;<br>
			...<br>
			end if<br>
			</em>
			<p>&lt;expression&gt; may be a variable, test, or a number<br>

			&lt;comparison&gt; must be from &gt;,&lt;,&lt;=,&gt;=,==,!=<br>
			== means equal to<br>
			!= means NOT equal to<br>
</blockquote>

<p>This statement executes the commands after an "if" if the comparison is satisfied. If it isn't 
it goes to the next else statement. The expressions may be numerical or strings (in which case &lt; and &gt; are interpreted as "is a substing of").<br>
<h4>Examples</h4>
<blockquote>
			<p>f11<br>
			{<br>

			&nbsp;&nbsp;if @text &lt;= "kill"<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"/action screams in rage!\r"<br>
			&nbsp;&nbsp;else if @text &lt;= "peace"<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"/action smiles and offers a bouquet of flowers.\r"<br>
			&nbsp;&nbsp;else<br>

			&nbsp;&nbsp;&nbsp;&nbsp;"/action sits there doing nothing.\r"<br>
			&nbsp;&nbsp;end if<br>
			}
			<p>// Looks for the substrings in @text
			<p>"/give"<br>
			{<br>
			&nbsp;&nbsp;"/give " @selplayer.name " " @text "\r"<br>

			&nbsp;&nbsp;set num @text<br>
			&nbsp;&nbsp;if @text &lt;= 10<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"/action tosses " @selplayer.name " a few coins.\r"<br>
			&nbsp;&nbsp;else if @text &lt;= 100<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"/action hands " @selplayer.name " a pouch of coins.\r"<br>

			&nbsp;&nbsp;else if @text &lt;= 1000<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"/action lugs a brimming bag of coins over to " @selplayer.name ".\r"<br>
			&nbsp;&nbsp;else<br>
			&nbsp;&nbsp;&nbsp;&nbsp;"/action tells " @selplayer.name " where he keeps his secret treasure hoard.\r"<br>
			&nbsp;&nbsp;end if<br>
			}
			<p>// For some facetious coin-giving<br>

</blockquote>
<h3>Label</h3>
<blockquote>
<p><em>label &lt;label name&gt;				</em></blockquote>
<p>Sets a place in a macro as a possible target for a goto command.
<h3>Goto</h3>
<blockquote>

<p><em>goto &lt;label name&gt;				</em></blockquote>
<p>Goes to the specified label and continues execution from there. With goto and label commands 
you can make loops (If you ever get in an infinite loop, remember holding down control-escape stops all macros)<br>
<h4>Examples</h4>
<blockquote>
			<p>f12<br>
			{<br>

			&nbsp;&nbsp;set num 0<br>
			&nbsp;&nbsp;label mark<br>
			&nbsp;&nbsp;set num + 1<br>
			&nbsp;&nbsp;if num &lt; 10<br>
			&nbsp;&nbsp;&nbsp;&nbsp;pause 5<br>

			&nbsp;&nbsp;&nbsp;&nbsp;"Counting: " num "\r"<br>
			&nbsp;&nbsp;&nbsp;&nbsp;goto mark<br>
			&nbsp;&nbsp;end if<br>
			}<br>
</blockquote>
<h3>Message</h3>

<blockquote>
			<p><em>message "&lt;text&gt;"<br>
message &lt;variable&gt;				</em></blockquote>
<p>Works just like the text command, but the output is shown in the sidebar. It isn't necessary to end 
the output with a "\r" character though. (Naturally it is only shown in YOUR sidebar, and this won't show up in movies.)
<h4>Examples</h4>
<blockquote>

			<p>"msg"<br>
			{<br>
			&nbsp;&nbsp;message @text<br>
  }                            
</blockquote>
		<hr>
		<p>
			This page is an edited version of the file located at <a href="http://www.deltatao.com/clanlord/macros/manual.html">Clan Lord's Macro Manual</a>.
			<br>
			All copyrights and rights are owned by <a href="http://www.deltatao.com">Delta Tao Software</a>
		</p>
		<p>
			<a href="http://validator.w3.org/check?uri=referer"><img
				src="http://www.w3.org/Icons/valid-html401-blue"
				alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
		</p>
	</body>
</html>